// 封装request请求

const baseUrl = 'https://sapi.k780.com'

const requestHttp = (params) => {
  wx.showLoading({
    title: '加载中',
  })
  return new Promise((resolve, reject) => {
    wx.request({
      url: baseUrl,
      data: {
        ...params,
        sign: '14f1604f9063531c677a37b45fbb38f4',
        appkey: '59280',
      },
      success: (res) => {
        resolve(res)
      },
      fail: (error) => {
        reject(error)
      },
      complete: () => {
        wx.hideLoading()
      },
    })
  })
}
export default requestHttp
